/*
 +----------------------------------------------------------------------
 + Title        : 店铺收藏接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-08-10
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 店铺收藏接口
 +----------------------------------------------------------------------
*/

import request from '@/utils/httpRequest'

/**
 * 店铺收藏列表
 * 
 * 参数 params 包含以下数据
 * {
 *      shop_id, ------------------------------------------------非必传,店铺ID
 *      page, ----------------------------------------------------非必传,页码
 *      page_size, -----------------------------------------------非必传,条数
 * }
 *
 * return json
 * author huwl
 */
export const reqUserShopCollectListAPI = (params) => {
    return request({
        method: 'GET',
        url: 'userShopCollect/list',
        params
    })
}

/**
 * 店铺收藏数量
 * 
 * 参数 params 包含以下数据
 * {
 *      goods_id, ------------------------------------------------非必传,店铺ID
 * }
 *
 * return json
 * author huwl
 */
export const reqUserShopCollectTotalAPI = (params) => {
    return request({
        method: 'GET',
        url: 'userShopCollect/total',
        params
    })
}

/**
 * 收藏店铺
 * 
 *  @param goods_id-----------------------------------------店铺ID
 *
 * return json
 * author huwl
 */
export const reqAddUserShopCollectAPI = (goods_id) => {
    return request({
        method: 'POST',
        url: 'userShopCollect/add',
        data: {goods_id}
    })
}

/**
 * 取消收藏店铺
 * 
 *  @param goods_id-----------------------------------------店铺ID
 *
 * return json
 * author huwl
 */
export const reqCancelUserShopCollectAPI = (id) => {
    return request({
        method: 'POST',
        url: 'userShopCollect/cancel',
        data: {ids:id}
    })
}